package org.example.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author 莫磊
 * @date 2025/8/8
 * @description
 */
@Controller
@RequestMapping("/user")
public class UserController {

	@RequestMapping("/getUser")
	public String getUser(){
		return "getUser";
	}

	@RequestMapping("/detail")
	public String detail(){
		return "detail";
	}

	/**
	 * ant风格的路径匹配符
	 *      ？匹配任意一个字符
	 *      *匹配任意多个字符
	 *      **匹配任意多个目录（左边只能是/，不能出现其他字符。spring5之前可以，spring6后不行只能出现在路径末尾/test/**）
	 *
	 *
	 * @return
	 */
	// @RequestMapping(value = "/testHeader", headers = {"!Referer=http://localhost:8080/springMVC_002/", "Host"})
	@RequestMapping(value = "/testHeader", headers = {"Host"})
	public String test(){
		return "user/detail";
	}

}
